#!/usr/bin/python
# -*- coding: utf-8 -*-

#列表
#查
# name_list = ['lili', 'huahua', 'xiaoxiao']
# print(name_list[0])
# print(name_list[-1])
# print(name_list[1])
#
#
# #index()   查找指定数据下标
# print(name_list.index('lili'))
# # print(name_list.index('lili', 1, 2))
# print(name_list.index('lili', 0, 2))
#
# #count()   统计元素在列表中出现的次数
# print(name_list.count('huahua'))
# print(name_list.count('lili'))
#
# #len()    统计列表长度
# print(len(name_list))


#判断
# print('lili' in name_list)
# print('huahua' not in name_list)
# name_list = ['lili', 'huahua', 'xiaoxiao']
# a = input('请输入一个名字: ')
# for a in name_list:
#     print('有这个人,')
# else:
#     print('没有这个人，是新来的吗？')

#新增
#append  追加元素到列表结尾
# name_list.append('xiaoming')
# print(name_list)
#
# name_list.append(['xiaohong', 'xiaobai', 'xiaohuang'])
# print(name_list)
#
# #extend   在列表后，追加一个序列
# name_list.extend(['xiaozi', 'baibai', 'huanghuang'])
# print(name_list)
#
#
#
# #insert()    将元素追加到指定位置
# name_list.insert(1, 'Tom')
# print(name_list)
#
# #del()     删除元素
# del name_list[5]
# print(name_list)
#
# del name_list[0]
# print(name_list)
#
# #pop
# print(name_list.pop(1))
# print(name_list)
#
# #remove
# name_list.remove('Tom')
# print(name_list)
#
# name_list.clear()
# print(name_list)

# name_list = ['lili', 'huahua', 'xiaoxiao']
# #修改 根据下标修改
# name_list[0] = 'aaa'
# print(name_list)

#倒序打印  reverse      修改原始数据
# num_list = ['8', '1', '5', '2', '4', '3', '9', '0']
# # num_list.reverse()
# print(num_list)
# #reversed()    不修改原始数据，倒序排列
# list1 = list(reversed(num_list))
# print(list1)


#排序 sort()
# num_list.sort()
# print(num_list)
# num_list.sort(reverse = True)
# print(num_list)


# num_list = ['8', '1', '5', '2', '4', '3', '9', '0']
# print(num_list)
# a = list(sorted(num_list))
# print(a)

#copy  复制一个新列表
# num2 = num_list.copy()
# print(num2)




#列表的循环遍历
# num_list = ['8', '1', '5', '2', '4', '3', '9', '0']
# i = 0
# while i < len(num_list):
#     print(num_list[i])
#     i += 1
#
# print('-------------------')
# for a in num_list:
#     print(a)

name_list = [['⼩明', '⼩红', '⼩绿'], ['Tom', 'Lily', 'Rose'], ['张三', '李四', '王五']]
print(name_list[1][2])
